home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 April / macformat-049.iso / mac / Shareware Plus / Developers / dropg++ / usr / include / stand / saio.h next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  3.8 KB  |  92 lines  |  [TEXT/R*ch]

  1. /*-
  2.  * Copyright (c) 1993
  3.  *    The Regents of the University of California.  All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  *
  33.  *    @(#)saio.h    8.1 (Berkeley) 6/11/93
  34.  */
  35.  
  36. /* I/O block */
  37. struct iob {
  38.     int    i_flgs;        /* flags (see F_*) */
  39.     int    i_adapt;    /* adapter or bus */
  40.     int    i_ctlr;        /* controller */
  41.     int    i_unit;        /* pseudo device unit */
  42.     int    i_part;        /* disk partition */
  43.     daddr_t    i_boff;        /* block offset on device */
  44.     daddr_t    i_cyloff;    /* cylinder offset on device */
  45.     off_t    i_offset;    /* seek offset in file */
  46.     dev_t    i_dev;        /* associated device */
  47.     daddr_t    i_bn;        /* 1st block # of next read */
  48.     char    *i_ma;        /* memory address of I/O buffer */
  49.     int    i_cc;        /* character count of transfer */
  50.     int    i_error;    /* error # return */
  51.     int    i_errcnt;    /* error count for driver retries */
  52.     int    i_errblk;    /* block # in error for error reporting */
  53. };
  54.  
  55. /* Codes for sector header word 1 */
  56. #define    HDR1_FMT22    0x1000    /* standard 16 bit format */
  57. #define    HDR1_OKSCT    0xc000    /* sector ok */
  58. #define    HDR1_SSF    0x2000    /* skip sector flag */
  59.  
  60. /* I/O flag values */
  61. #define    F_READ        0x0001    /* file opened for reading */
  62. #define    F_WRITE        0x0002    /* file opened for writing */
  63. #define    F_ALLOC        0x0004    /* buffer allocated */
  64. #define    F_FILE        0x0008    /* file instead of device */
  65. #define    F_NBSF        0x0010    /* no bad sector forwarding */
  66. #define    F_ECCLM        0x0020    /* limit # of bits in ecc correction */
  67. #define    F_SSI        0x0040    /* set skip sector inhibit */
  68. #define    F_SEVRE        0x0080    /* Severe burnin (no retries, no ECC) */
  69.  
  70. /* I/O types */
  71. #define    F_RDDATA    0x0100    /* read data */
  72. #define    F_WRDATA    0x0200    /* write data */
  73. #define    F_HDR        0x0400    /* include header on next i/o */
  74. #define    F_CHECK        0x0800    /* perform check of data read/write */
  75. #define    F_HCHECK    0x1000    /* perform check of header and data */
  76.  
  77. #define    F_TYPEMASK    0xff00    /* I/O type mask */
  78.  
  79. #ifdef COMPAT_42
  80. /*
  81.  * Old drive description table.
  82.  * still used by some drivers for now.
  83.  */
  84. struct st {
  85.     short    nsect;        /* # sectors/track */
  86.     short    ntrak;        /* # tracks/surfaces/heads */
  87.     short    nspc;        /* # sectors/cylinder */
  88.     short    ncyl;        /* # cylinders */
  89.     short    *off;        /* partition offset table (cylinders) */
  90. };
  91. #endif
  92.